﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Animoso.Domain;
using Animoso.Domain.Data;
using NHibernate;
using NHibernate.Criterion;

namespace Animoso.Data
{
    public class SectionRepository : BaseRepository<Section>, ISectionRepository
    {
        public IList<Section> GetSectionsByPosition(Position position)
        {
            using(ISession session = SessionProvider.GetSession())
            {
                return session.CreateCriteria(typeof (Section))
                    .Add(Expression.Eq("Position", position))
                    .List<Section>();
            }
        }
    }
}
